home *** CD-ROM | disk | FTP | other *** search
- /*
- * FILE: app.c
- * AUTHOR: R. Gonzalez
- * CREATED: August 25, 1990
- *
- * Defines generic application methods.
- */
-
- # ifdef THINK_C
- # include <oops.h>
- # endif
-
- # include <stdlib.h>
- # include "app.h"
-
- static boolean quit(Generic_App*);
-
- /************************************************************************
- * initialize application. Derived abstract application classes
- * should call the inherited init method first in their own inits.
- ************************************************************************/
- boolean Generic_App::init(void)
- {
- done = FALSE;
- menu = new(Menu);
- menu->init();
- menu->log_command(1,0,"File",NULL);
- menu->log_command(1,1,"Quit",quit);
-
- return TRUE;
- }
-
- /************************************************************************
- * execute application - this is handled in derived abstract classes
- ************************************************************************/
- void Generic_App::run(void)
- {
- }
-
- /************************************************************************
- * get string from user - this is handled in derived abstract classes.
- * All I/O should be accomplished with query() and respond().
- ************************************************************************/
- void Generic_App::query(char *question,char answer[])
- {
- }
-
- /************************************************************************
- * reply to user - this is handled in derived abstract classes.
- * All I/O should be accomplished with query() and respond().
- ************************************************************************/
- void Generic_App::respond(char *response)
- {
- }
-
- /************************************************************************
- * terminate application. Derived abstract application classes
- * should call the inherited method.
- ************************************************************************/
- boolean Generic_App::destroy(void)
- {
- menu->destroy();
- delete(menu);
-
- return TRUE;
- }
-
- /*------------------------ command functions --------------------------*/
-
- /************************************************************************
- * quit - by default the only command available.
- ************************************************************************/
- boolean quit(Generic_App *app_ptr)
- {
- app_ptr->done = TRUE;
- return TRUE;
- }
-
-
-